Sprintf
Edit entry
编辑词条 -->
The string formatting command is mainly used to write formatted data into a string. Sprintf is a variable parameter function, which often causes problems when used, and as long as there is a problem,
sprintfString formatting commands, the main function is to write formatted data into a string. sprintf is a variable parameter function, often problems when used, and as long as the problem is usually can cause the program crashes the memory access
When constructing various types of data into strings, the powerful features of sprintf seldom disappoint you. Since sprintf and printf have almost the same usage, but the printing destination is different, the former is printed into the string, and
Turn from: http://blog.csdn.net/willy3000/article/details/5786888
The parameter type of the character; output formd,i int type; Displays a signed decimal number (I and D are different when used in the scanf function).o int type; unsigned octal
1.4 Types of formatted output differences
PRINTF,FPRINTF,SPRINTF are formatted output commands, and their usage and differences can be viewed through Linux commands "man printf".int printf (const char *format,***) Prints the format to the STDOUTThe
Php echo, print, print_r, printf, sprintf, var_dump usage introduction. This article introduces echo, print, print_r, printf, sprintf, and var_dump. For more information, see. I. definition and usage of echo: The PHPecho () function outputs one or
Start
I used to think that stringstream is far inferior to sprintf.
Recently, it suddenly sprouted to see if stirngstream is really as bad as I thought.
Body
Let's take a look at the comparison.
// Stringstream.
Stringstream
This article introduces echo, print, print_r, printf, sprintf, and var_dump. For more information, see. 1. define echo and use the PHPecho () function to output one or more string methods.
This article introduces echo, print, print_r, printf,
Start
I used to think that stringstream is far inferior to sprintf.
Recently, it suddenly sprouted to see if stirngstream is really as bad as I thought.
Body
Let's take a look at the comparison.
// Stringstream.
Stringstream
1.Print(Language structure)Pirnt-Output stringint print ( string $arg )Example:输出:Hello World!print("Hello World!");等价于:print "Hello World!";Attention:
Print is a language structure and can enclose the argument list without parentheses;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.